package adv324;

/**
 * @author oldliu
 * @since 1.0
 */
public class SystemTest2 {
    public static void main(String[] args) {
        long start=System.nanoTime();
        int a=23;
        int b=444;
        int c=a*b;
        System.out.println(c);
        long end=System.nanoTime();
        System.out.println("c*b耗时"+(end-start)+"纳秒");
        System.out.println("扩容数组：=========");
        int a1[]={1,2,3,4,5,6,7,8,9,10};
        int a2[]=new int[(int) (a1.length*1.5+1)];
        //a1的值挨个放入a2中；
        //方法1：
//        for (int i = 0; i < a1.length; i++) {
//            a2[i]=a1[i];
//        }
        //方法2：
        System.arraycopy(a1,3,a2,3,a1.length-3);
        System.arraycopy(a1,0,a1,3,4);

        for (int i = 0; i < a1.length; i++) {
            System.out.print(a1[i]+" ");
        }
        System.out.println();
        for (int i = 0; i < a2.length; i++) {
            System.out.print(a2[i]+" ");
        }
        System.out.println();
    }
}
